package com.lone.design.pattern.creational.singleton.demo2;

/**
 * @author Lone
 * @date 2021/9/23 16:57 周四
 * 饿汉式
 *       在静态代码块中创建该类对象
 */
public class Singleton {
    private Singleton() {

    }

    private static Singleton instance;

    static {
        instance = new Singleton();
    }

    public static Singleton getInstance() {
        return instance;
    }
}
